/**
 * Licensed under the Apache License, Version 2.0 (the "License"); you may
 * not use this file except in compliance with the License. You may obtain
 * a copy of the License at
 * 
 *         http://www.apache.org/licenses/LICENSE-2.0
 *         
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License. Unless required by applicable law or
 * agreed to in writing, software distributed under the License is
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the specific
 * language governing permissions and limitations under the License.
 */
package org.rhok.pdx.ncn.datatypes;

import android.location.Location;

/**
 * Simple storage class. Holds information regarding a particular location and the wifi / cell
 * signal strengths found at the time provided.
 * @author pfritzsche
 */
public class LocationData extends Data {
	
	private Location loc;

	/**
	 * @param loc {@link Location} object the information is tied to
	 * @param signalStrength Signal strength of the cell phone signal while at the given location
	 * @param wifiStrength Wifi signal strength while at the given location
	 * @param time When the information was recorded, in millis since epoch
	 */
	public LocationData(Location loc, int signalStrength, int wifiStrength, long time) {
		super(signalStrength, wifiStrength, time);
		this.loc = loc;
	}
	
	/**
	 * Public constructor. Automatically stores the current time as when the data was created.
	 * @param loc {@link Location} object the information is tied to
	 * @param signalStrength Signal strength of the cell phone signal while at the given location
	 * @param wifiStrength Wifi signal strength while at the given location
	 */
	public LocationData(Location loc, int signalStrength, int wifiStrength) {
		this(loc, signalStrength, wifiStrength, System.currentTimeMillis());
	}
	
	/**
	 * Location getter.
	 * @return the location the data was collected at
	 */
	public Location loc() { return loc; }
}
